home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Loadstar 166
/
166.d81
/
b.fox & hounds
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-08-26
|
23KB
|
608 lines
1 poke 55,0:poke 56,112:clr:poke788,49:tq=ti:poke53371,0
2 dv=peek(186):if dv<8 then dv=8
3 poke53281,0:poke53280,0:print"":poke2024,dv:gosub60000
4 sys57812"newfont5/sprite3",dv,0:poke780,0:poke 781,0:poke 782,112:sys65493
5 sys57812"mr.mouse 9000" ,dv,0:poke780,0:poke 781,0:poke 782,144:sys65493
6 dv=peek(2024):rem can rerun from here without loading files again.
7 poke 53269,0: rem all sprites off
8 ml=36864:v=ml+111
9 if peek(788)=64 and peek(789)=148 then sysml+3
10 rem" [198][200]64.13 by [196]avid [218]ammat [202]anuary 17, 1988
11 [143]" ascox &closeleft$ounds on text screen with custom characters
12 rem to restore normal edit screen press "run/stop" and goto 600.
14 ifti<tq+200then14
20 poke 53280,5
25 gosub 250 : rem show title screen
26 gosub 100 : rem initialize variables
30 gosub 700: rem show scrolling animal sprites all 4 at once
31 rem gosub 281:poke 53269,0: rem print animal graphic strings
32 gosub 800
33 rem gosub 282:poke 53269,0
34 gosub 900
35 gosub 283:poke 53269,0
36 poke214,18:print:poke211,2:print "[144][208]ress[157][157][157][157][157]a key.":gosub 282:gosub 281
37 get k$:if k$="" then 37 :rem key pressed
38 wait 203,64:rem no key pressed
39 sc=30720:for a=sc+2043 to sc+2047:poke a ,229 :next:rem sprites 4-8 pointers
40 poke sc+ 2041,228 :poke sc+2042,228:rem pointers for sprites 2 and 3
41 for n=53287 to 53294:poke n,0:next :rem sprite colors
43 poke 53269,0:poke 53264,0
44 gosub 650 : gosub 150 : gosub 680: rem print information, start mr. mouse
45 gosub 120 : rem select game
46 if k$="l" then 605
48 gosub 620 : rem draw board and animals
49 gosub 165 : rem define regions for game
50 rem k$(1)="a":k$(2)="s":k$(3)="z":k$(4)="x":k$(5)="f":k$(6)="h":k$(7)="l"
51 gosub 390 : rem draw fox & hounds on board
52 gosub 380 : rem draw large sprite heads
53 goto 60
54 if k$="l" then 605
55 gosub 390 : rem new game: draw fox & hounds on board
60 if k$="f" then k$=" ":gosub 170:sysml+21,18,6 :gosub 1000:goto 54
65 if k$="h" then k$=" ":gosub 180:sysml+21,18,19:gosub 2000:goto 54
70 end
80 rem-quick restart-----
81 bk=-1:print"[147]":poke 53269,0:goto45
100 :rem --------initialize variables------------
101 c=0:r=0:x=0:y=0:n=0:cf=0:rf=0:cn=0:rn=0:h=5:w=0:bk=-1:wh=0:wf=0
102 sr=0:cs=0:rs=0:ac=0:d=0:h=5:t=0:l=0:sc=0:ba=33792
103 dim f(9,9),x(9,9),y(9,9),c(4),r(4),n(8,8)
104 for r=0 to 9:f(0,r)=3:f(9,r)=3:next:for c=1 to 8:f(c,0)=3:f(c,9)=3:next
105 y=210:forr=0to9:x=104:forc=0to9:x(c,r)=x:y(c,r)=y:x=x+16:next:y=y-16:next
106 f(1,1)=5:f(3,1)=6:f(5,1)=7:f(7,1)=8:f(4,8)=2:cf=4:rf=8
107 c(1)=1:r(1)=1:c(2)=3:r(2)=1:c(3)=5:r(3)=1:c(4)=7:r(4)=1
108 wh$=" [157][157] ":gy$="[155] [157][157] ":lr$="[150] [157][157] ":gn$=" [157][157] "
109 return
120 rem select game and play using keyboard, joystick, or mouse in any
121 rem combination.
122 k$(5)="f":k$(6)="h":k$(7)="l": wait 203,64:wait 56320,127:wait 56321,255
123 get k$:: if k$="" and peek(56320)=127and peek(56321)=255then123
124 if peek(56320)=111 or peek(56321)=239 then sys ml+9
125 if rg%>4 and rg%<8 then k$=k$(rg%): return
126 if k$ <>"" then wait 203,64:goto 130
128 goto 122
130 rem select game by keyboard
131 print "[147]" tab(12) "[212]o [211]elect [199]ame:"
132 print "[208]ress [198] to play [198]ox; [200] to play [200]ounds."
133 print"[195]omputer plays the other side."
134 print "[208]ress [204] to return to [204]oadstar."
135 get k$:if k$="" then 135
136 if k$="l" then return
137 if k$="h" then return
138 if k$="f" then return
139 goto 135
150 rem ----- start mr. mouse ------
151 sys 36864+21,0,0 :rem position
152 ml=36864:v=ml+111:sysml:sysml+6:poke 53269,0 :poke v,123:poke v+1,7
153 for c=704 to 767: poke c+30400,peek(c):next:rem copy sprite to unused area
154 sysml+3: poke 32760,230:rem pointer to sprite #1 (mouse pointer)
155 poke 53287,2 :rem color red
156 sysml+15,5,31,33,19,19:sysml+15,6,26,28,20,20:sysml+15,7,3,5,22,22
157 get k$:if k$="" then 157:rem wait for key press
158 wait 203,64:rem wait for key release
159 sysml+21,18,22:sysml:poke 53269,1: return
160 rem --,- set fox regions ---------
161 sysml+15,1, 8+2*cf, 9+2*cf,18-2*rf,19-2*rf:rem a
162 sysml+15,2,12+2*cf,13+2*cf,18-2*rf,19-2*rf:rem s
163 sysml+15,3, 8+2*cf, 9+2*cf,22-2*rf,23-2*rf:rem z
164 sysml+15,4,12+2*cf,13+2*cf,22-2*rf,23-2*rf:return:rem x ------------------
165 sysml+15,5,25,27,23,23 :rem set regions for f, h, l
166 sysml+15,6, 7, 9,23,23
167 sysml+15,7,10,12,24,24
169 return:rem -----------------------
170 print "[144]"tab(13)"[198]ox and [200]ounds"
171 poke214,17:print:poke211,1:print" ":print tab(6)" "
172 poke214,1 :print:poke211,1:print" [217]ou play [198]ox. [195]omputer plays [200]ounds. "
173 poke214,20:print:poke211,1:print" [208]ress [193], [211], [218],[160]or [216] to move [198]ox. "
174 print"[160] [212]o start new game:"
175 print" [208]ress([200])[144]to play [200]ounds,([198])[144]to play [198]ox.";
176 print " [208]ress([204])[144]to return to [204]oadstar. ";
178 gosub 193
179 return
180 print "[144]"tab(13)"[198]ox and [200]ounds":poke 214,18:print:poke 211,6:print"1"
181 poke214,17:print:poke 211,1:print"[205]ove [200]ound"
182 poke214,1 :print:poke 211,1:print" [217]ou play [200]ounds. [195]omputer plays [198]ox. "
183 poke214,20:print:poke 211,1:print" 1, 2, 3, or 4 selects [200]ound; [209] or [215]";
184 poke214,21:print:poke211,1:print" moves. [212]o start new game:" ;
185 poke214,22:print:poke211,1
186 print" [208]ress([200])[144]to play [200]ounds,([198])[144]to play [198]ox." ;
187 print " [208]ress([204])[144]to return to [204]oadstar. ";
188 ml=36864:gosub 190:rem set regions for hounds
189 gosub 194:return:rem define k$(rg%)
190 rem set regions of 4 hounds
191 for c=1 to 4:sysml+15,c,10+2*c(c),11+2*c(c),20-2*r(c),21-2*r(c):next:
192 poke v+1,7:return
193 k$(1)="a":k$(2)="s":k$(3)="z":k$(4)="x":k$(5)="f":k$(6)="h":k$(7)="l":return
194 k$(1)="1":k$(2)="2":k$(3)="3":k$(4)="4":k$(5)="f":k$(6)="h":k$(7)="l":return
250 q$=chr$(34): rem title screen
251 poke 53272 ,252:rem put screen at 29696 and font at 30720 in video bank 1
252 poke53280,1 :poke 53281,1:poke 56576,198:poke 648,124:print"[147]";
253 rem the font has no reversed space character, so no cursor on screen.
254 for x=29952 to 29959 :poke x,255:next :rem now have cursor
255 h1$="[144]!"+q$+q$+"[157]"+"#$%[146]"
256 rem h1$="[144]"+chr$(33)+chr$(34)+chr$(34)+"[157]"+chr$(35) thru chr$(37)+"[146]"
257 h2$="[144][161][162][163][164][165][146]" :rem h2$="[144]"+chr$(225)thru chr$(229)+"[146]"
258 f1$="-./01[146]" :rem f1$=""+chr$(45) thru chr$(49)+"[146]"
259 f2$="[173][174][175][176][177][146]" :rem f2$=""+chr$(237) thru chs$(241)+"[146]"
260 t1$="[149]@abcdefghijklmnopqrstuvwxyz[\]^_[192][146]"
261 t2$="[149][192][193][194][195][196][197][198][199][200][201][202][203][204][205][206][207][208][209][210][211][212][213][214][215][216][217][218][219][220][221][255][223][160][146]"
262 f$=f1$+"[157][157][157][157][157]"+f2$+"[145]" : h$=h1$+"[157][157][157][157][157]"+h2$+"[145]"
263 poke214,10:print: print " "t1$:print " " t2$
264 print "[149][204]oadstar presents"
265 :
266 print "[193][160][200]unt [199]ame"
267 print "[207]n a [195]hecker [194]oard"
268 print "[149]by[160][196]avid [218]ammat"
275 poke 214,4:print:poke 211,1:print"[157][166][157][166][157][166][157][166][157][166][157][166][157][166][157][166][157][166][157][166][157][166][157][166][157][166]"
276 poke 214,5: print:poke 211,40:print"[157][166][157][166][157][166][157][166][157][166][157][166][157][166][157][166][157][166][157][166][157][166][157][166]"
277 poke214,5: print:poke211,0:print"[149][166][166][166][166][166][166][166][166][166][166][166][166][166][166][166][166][166][166][166][166][166][166][166][166][166][166][166][166][166][166][166][166][166][166][166][166][166][166][166][166]"
278 poke214,17:print:poke211,0:print"[149][166][166][166][166][166][166][166][166][166][166][166][166][166][166][166][166][166][166][16